#ifndef BLOBCOLLECTIVE_H_INCLUDED
#define BLOBCOLLECTIVE_H_INCLUDED

#include <vector>

#include "Blob.h"
#include "Environment.h"
#include "Point.h"
#include "Vector.h"

namespace BlobSalladDS
{
	class BlobCollective
	{
		private:
			int maxNum;
			int numActive;
			std::vector<Blob *> *blobs;
			Vector *tmpForce;
			Blob *selectedBlob;

			/**
			 * Generates a double between 0 and 1.
			 */
			double drand();
		public:
			BlobCollective(int x, int y, int startNum, int maxNum);
			void split();
			int findSmallest(int exclude);
			int findClosest(int exclude);
			void join();
			POINT selectBlob(int x, int y);
			void unselectBlob();
			void selectedBlobMoveTo(int x, int y);
			void move(double dt);
			void sc(Environment &env);
			void setForce(Vector *force);
			void addForce(Vector &force);
			void draw(void * ctx, double scaleFactor);
	};
}

#endif // BLOBCOLLECTIVE_H_INCLUDED
